#!/bin/bash

if [ $# -ne 2 ];
then
	echo " $0 filename string_length"
	exit -1
fi

filename=$1;
basepattern='/^\(.\)'
count=$(( $2 / 2 ))

for((i=1;i<$count;i++))
do
	basepattern=$basepattern'\(.\)';
	echo $basepattern;
done

if [ $(( $2 / 2 )) -ne 0 ];
then
	basepattern=$basepattern'.';
fi;
echo $basepattern


for((count;count>0;count--))
do
	basepattern=$basepattern'\'"$count";
done

echo $basepattern


